<?php
include "kt_login.php";
include "../config.php";
$db = new lg_mysql($host,$dbuser,$dbpass,$csdl);
include "kt_admin.php";
include "function.php";
?>
<div id="loading">
<center>
<form action="?act=log_list" method="post" onsubmit="return confirm('Bạn có chắc chắn không ?');">
<input type="hidden" name="func" value="del" />
<input type="hidden" name="id" value="<?=$id?>" />
<table class="tb_table" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr class="tb_head">
	<td>STT</td>
	<td>Tên</td>
   	<td>Loại</td>
    <td>Menu</td>
	<td>Ngày đăng</td>
	<td>Người đăng</td>
</tr>
<?php
$count	=	0;
$x	=	explode("/",$date);
$rs	=	$db->select("fan_log","","order by time desc");
while ($row = $db->fetch($rs))
{
	$date_db = lg_date::vn_date($row["time"]);
	$y	=	explode("/",$date_db);
	if($x[0] == $y[0] && $x[1] == $y[1] && $x[2] == $y[2])
	{
		$count++;
		?>
        <tr class="tb_content">
            <td><?=$count?></td>
            <td><?=$row["ten"]?></td>
            <td>
            <?php
            if($row["loai"] == 1) echo "Bài viết";
            if($row["loai"] == 2) echo "File tài liệu";
            if($row["loai"] == 3) echo "Hình ảnh";
            if($row["loai"] == 4) echo "Trang nội dung";
            if($row["loai"] == 5) echo "Sản phẩm";
            ?>   
            </td>
            <td>
            <?php
            if($row["loai"] == 1)
            {
                $q = $db->select("cms_menu","id = '".$row["cat"]."'");
                while($r = $db->fetch($q))
                {
                    echo $r["ten"];
                }
            
            }
            if($row["loai"] == 2)
            {
                $q = $db->select("doc_menu","id = '".$row["cat"]."'");
                while($r = $db->fetch($q))
                {
                    echo $r["ten"];
                }
            
            }
            if($row["loai"] == 3)
            {
                $q = $db->select("gallery_menu","id = '".$row["cat"]."'");
                while($r = $db->fetch($q))
                {
                    echo $r["ten"];
                }
            
            }
            if($row["loai"] == 4)
            {
                echo "Trang nội dung";
            }
            if($row["loai"] == 5)
            {
                $q = $db->select("product_menu","id = '".$row["cat"]."'");
                while($r = $db->fetch($q))
                {
                    echo $r["ten"];
                }
            }          
            ?>
            
            </td>
            <td><?=lg_date::vn_time($row["time"])?></td>
            <td><a href="?act=member_edit&id=<?=$row["user"]?>"><?=get_user($row["user"],"username")?></a></td>
        </tr>
        <?php
	}
	else
	{
	?>	
    <tr class="tb_content">
    <td colspan="8"><?php die("Không tìm thấy dữ liệu")?></td>
    </tr>
	<?php
    }
}
?>
<!--<tr class="tb_foot">
	<td colspan="5" style="text-align:left;">
		<strong>Trang : </strong>
		<?php
			if ($pages==0) echo ":1:";
    		for($i=1;$i<=$pages;$i++) {
    			if ($i==$page) echo "<b>[".$i."]</b>";
    			else {
					echo "<a href='?act=log_list&id=".$id."&page=$i'>-$i-</a>";
				}
			}
    	?>
	</td>
	<td>  
    </td>
</tr>-->
</table>
</table>
</form>
</center>
</div>
<div class="function">
</div>
